package com.seveneight.baijiesteward.ui.user.presenter;

import android.content.Context;

import com.seveneight.baijiesteward.bean.BranchBean;
import com.seveneight.baijiesteward.http.MyCallBack;
import com.seveneight.baijiesteward.ui.user.contract.BranchBankContract;
import com.seveneight.baijiesteward.ui.user.model.BranchBankModel;

import java.util.List;

import okhttp3.RequestBody;

/**
 * Created by user1 on 2018/4/14.
 */

public class BranchBankPresenter implements BranchBankContract.BranchBankPresenter {

    BranchBankContract.BranchBankView branchBankView;
    BranchBankContract.BranchBankModel branchBankModel;

    public BranchBankPresenter(BranchBankContract.BranchBankView branchBankView) {
        this.branchBankView = branchBankView;
        branchBankModel = new BranchBankModel();
    }

    @Override
    public void getBankList(Context context, RequestBody body) {
        branchBankModel.getBankList(context, body, new MyCallBack<List<BranchBean>>() {
            @Override
            public void onSuccess(List<BranchBean> branchBeans) {
                branchBankView.reBackCreditCardList(branchBeans);
            }

            @Override
            public void onFailed() {

            }
        });
    }
}
